package io.github.wslxm.springbootplus2.core.utils.tree;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.LinkedList;
import java.util.List;

/**
 * tree 工具类 父对象
 *
 * @author wangsong
 * @version 1.0.0
 * @mail 1720696548@qq.com
 * @date 2022/11/21 0021 9:25
 */
@Data
public class BaseTree<T, S> {

    @ApiModelProperty(value = "id", position = -10)
    private S id;

    @ApiModelProperty(value = "父节点id", position = -9)
    private S pid;

    @ApiModelProperty(value = "父节点 tree", notes = "从子级 .fatherNode 获取父级, .fatherNode.fatherNode 获取父级的父级 (默认没有数据, 后端处理后存在数据)", position = -8)
    private T fatherNode;

    @ApiModelProperty(value = "父节点 list", notes = "按父级到子级节点顺序存放 (默认没有数据, 后端处理后存在数据)", position = -7)
    private LinkedList<T> fathers;

    @ApiModelProperty(value = "节点名称", position = -6)
    private String name;

    @ApiModelProperty(value = "下级节点", position = -5)
    private List<T> children;



}
